package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.chargingStation;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.chargingStation.ChargingStationService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: ChargingStationController
 * @Date: Created in 13:13 2023/12/21
 * @Description: 充电桩
 */
@Action
@RequestMapping(value="chargingStation/chargingStation")
public class ChargingStationController {

    @Resource
    private ChargingStationService chargingStationService;
    /**
     * 首页数据
     * @param
     * @return
     */
    @At(value = "getHomePageData", method = RequestMethod.GET, param = { "nums","type","userType"})
    public RespEntity getHomePageData(@RequestBody(required = false) JSONObject jsonParam) {
        return chargingStationService.getHomePageData(jsonParam);
    }

    /**
     * 实时报警列表
     * @param
     * //alarmType	报警类型
     * @return
     */
    @At(value = "realTimeAlarm", method = RequestMethod.GET)
    public RespEntity realTimeAlarm(@RequestBody(required = false) JSONObject jsonParam) {
        return chargingStationService.realTimeAlarm(jsonParam);
    }

    /**
     * 一周报警
     * @param
     * //businessId    单位id	否	这个参数有值时，1步骤就不用做了，直接用这个单位id进行查询即可
     * type	1 一周  2  本月	是	说明一下：以下是用type==1举例的；当type==2时，需要返回整个自然的月的数据
     * @return
     */
    @At(value = "weekAlarm", method = RequestMethod.GET)
    public RespEntity weekAlarm(@RequestBody(required = false) JSONObject jsonParam) {
        return chargingStationService.weekAlarm(jsonParam);
    }
}
